The present disclosure relates to an embroidery data generating device and a computer-readable medium that stores an embroidery data generating program that generate embroidery data that is used by an embroidery sewing machine to produce an embroidered pattern based on a photographic image or the like.
An embroidery data generating device is known that automatically generates embroidery data based on a photographic image or the like in which grayscale values, colors, and the like vary continuously in two dimensions. More specifically, based on image data of a photographic image or the like, line segment information that has angles is first generated from an image that is inputted. Next, thread color information for each of the line segments is set in accordance with color information in the inputted image. Then, for each of the thread colors, distances between the endpoints of each of the line segments are calculated. The embroidery data that is suitable for use by the embroidery sewing machine is generated by sequentially connecting an endpoint of a line segment to the closest endpoint of another line segment.
The number of line segments that are generated based on the data for an image ranges from several thousand to several tens of thousands. Accordingly, an embroidery data generating device is known that is capable of shortening the time that is required to calculate connection of the line segments. Specifically, a sequential search is performed for the line segments within a block, in accordance with a search order that is determined based on a search hierarchy table, until a specified search range is exceeded. A distance between an ending endpoint of a current line segment and an endpoint of a line segment that is newly found by the line segment search is compared to a distance between the ending endpoint of the current line segment and an endpoint of a line segment that was previously found. The line segment for which the distance is shorter is outputted as the next line segment. By eliminating the need to perform calculations for all of the line segments that are generated based on the data for the image, the time that is required to calculate the connection of the line segments may be shortened.